home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_31005.txt < prev    next >
Text File  |  1991-02-27  |  2KB  |  37 lines

  1. -- card: 31005 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. C programs are usually divided into several source files, to improve modularity and to speed program development.  (Only the altered functions need to be recompiled.)
  11.  
  12. By default function identifiers have FILE SCOPE, so the function can be accessed from any point following its declaration in a source file, and from any other source files which provide a suitable declaration*.
  13.  
  14. Recall that a function 'definition' describes the structure of the function whereas a 'declaration' simply informs the compiler of the types of the function's return value and arguments.  A complete function definition involves both the function prototype   (the header) and the function body.  A function definition also serves as a function declaration.  Therefore if the called function's definition precedes the calling function in the source file, then no further declaration is needed.
  15.  
  16. If, however, a function is called before it is defined in the source file, or if the function is called from a function in another source file, then a declaration must be given.  A function is declared simply by giving the prototype followed by a semicolon.  It is not necessary to list the names of the formal parameters; only their types.  For 
  17.  
  18.  
  19. -- part contents for background part 6
  20. ----- text -----
  21. 3.3  Scope
  22.  
  23. -- part contents for background part 7
  24. ----- text -----
  25. 93
  26.  
  27. -- part contents for background part 29
  28. ----- text -----
  29. 20338
  30.  
  31. -- part contents for background part 27
  32. ----- text -----
  33. ANSI C scopes
  34.  
  35. -- part contents for background part 20
  36. ----- text -----
  37. ANSI C scopes - p75